package com.aoorey.util;

import java.util.Map;

public class ResultUtil {
	public static void makeResult(int resCode, Map<String, Object> retMap) {
		if (retMap == null) {
			return;
		}

		String resKey = "result";
		String resDesc = "desc";

		switch (resCode) {
		case Default.SUCCESS:
			retMap.put(resKey, new Integer(Default.SUCCESS));
			retMap.put(resDesc, Default.SUCCESS_DESC);
			break;

		case Default.FAILED:
			retMap.put(resKey, new Integer(Default.FAILED));
			retMap.put(resDesc, Default.FAILED_DESC);
			break;

		case Default.INVALID_PARAMS:
			retMap.put(resKey, new Integer(Default.INVALID_PARAMS));
			retMap.put(resDesc, Default.INVALID_PARAMS_DESC);
			break;
		default:
			break;
		}
	}
}
